// JavaScript Document

function Validate_Request_Type(frmName){  //               Common Java Script Files   

	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('request_type').value=="0"){
		errorMsg[cntError] = 'Please Select Request Type & Employee Type';
		errorField[cntError] = 'request_type';
		cntError++;
		var Output2 = 'Please Select Request Type & Employee Type';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		
		if(document.getElementById('employee_type').value=="0"){
		errorMsg[cntError] = 'Please Select Request Type & Employee Type';
		errorField[cntError] = 'employee_type';
		cntError++;
		var Output2 = 'Please Select Request Type & Employee Type';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
		
		if(document.getElementById('indnew').value=="0"){
		errorMsg[cntError] = 'Please Press Go Button';
		errorField[cntError] = 'indnew';
		cntError++;
		var Output2 = 'Please Press Go Button';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
	if(document.getElementById('indnew').value=="2")		
	{		
	
	
	if(document.getElementById('lap_type').value=="0"){
		errorMsg[cntError] = 'Please Select Laptop Type';
		errorField[cntError] = 'lap_type';
		cntError++;
		var Output2 = 'Please Select Laptop Type';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
	
	
	
		if(document.getElementById('emp_oldno').value==""){
		errorMsg[cntError] = 'Please Enter Employee Number';
		errorField[cntError] = 'emp_oldno';
		cntError++;
		var Output2 = 'Please Enter Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
		if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			/*
				if(document.getElementById('laptop_model').value=="0"){
		errorMsg[cntError] = 'Please Select Laptop Model';
		errorField[cntError] = 'laptop_model';
		cntError++;
		var Output2 = 'Please Select Laptop Model';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		*/
			
			
			
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}			
			
			
			
	}
	
	
	
	
	
	
	
	
	
	
	
	if(document.getElementById('indnew').value=="4")		
	{	
		

		if(document.getElementById('grpemp').value=="0")
		{
		var addgrpemp = 0;
		}
		
		else
		{
		var addgrpemp = document.getElementById('addgrpemp').value;	
		}
		
	

    for (var x = 0; x <= addgrpemp; x++)
    {
	   
	   if(document.getElementById('emp_oldno'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Number';
		errorField[cntError] = 'emp_oldno'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
	   
	   
	
	   
				
		
   }
			
		if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			/*
				if(document.getElementById('laptop_model').value=="0"){
		errorMsg[cntError] = 'Please Select Laptop Model';
		errorField[cntError] = 'laptop_model';
		cntError++;
		var Output2 = 'Please Select Laptop Model';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		*/
			
			
			
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}			
			
			
			
	}
	
	
	
	
	
	
	
	
		if(document.getElementById('indnew').value=="3")		
	{	
		

		if(document.getElementById('grpemp').value=="0")
		{
		var addgrpemp = 0;
		}
		
		else
		{
		var addgrpemp = document.getElementById('addgrpemp').value;	
		}
		

	for (var x = 0; x <= addgrpemp; x++)
   {
   
	   
	   if(document.getElementById('empno'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Number';
		errorField[cntError] = 'empno'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
	   
	   
	
	   
	
		if(document.getElementById('emp_fname'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee First Name';
		errorField[cntError] = 'emp_fname'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee First Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
			
			
			if(document.getElementById('emp_lname'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Last Name';
		errorField[cntError] = 'emp_lname'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Last Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
						if(document.getElementById('emp_desn'+x+'').value=="0"){
		errorMsg[cntError] = 'Please select Your Employee Designation';
		errorField[cntError] = 'emp_desn'+x+'';
		cntError++;
		var Output2 = 'Please select Your Employee Designation';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	

			
			
				
			if(document.getElementById('emp_address'+x+'').value=="" ){
		errorMsg[cntError] = 'Please Enter Your Employee Address';
		errorField[cntError] = 'emp_address'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Address';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			
			if(document.getElementById('emp_telno'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Telephone No';
		errorField[cntError] = 'emp_telno'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Telephone No';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
     if(!validateEmail(document.getElementById('emp_email'+x+'').value,1,1)){
	errorMsg[cntError] = 'Email is not in Proper format';
	errorField[cntError] = 'emp_email'+x+'';
		cntError++;
	var Output2 = 'Please Enter Your Email Address';
		document.getElementById("resultshere1").innerHTML = Output2;
		return false;
	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
	
		}
			
			
			
			
				if(document.getElementById('depot'+x+'').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot'+x+'';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
	if(document.getElementById('division'+x+'').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division'+x+'';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			/*
				if(document.getElementById('laptop_model'+x+'').value=="0"){
		errorMsg[cntError] = 'Please Select Laptop Model';
		errorField[cntError] = 'laptop_model'+x+'';
		cntError++;
		var Output2 = 'Please Select Laptop Model';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		*/
			
			
			
					
			
		
			
			
			
			
			
			
				
   }
   
   
   
   	
			
				
   
   
   
			
		
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}			
			
			
			}
	
	
	
	
	
	
	
	
	
	
	
	
	
			
				
	if(document.getElementById('empno').value=="" && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Number';
		errorField[cntError] = 'empno';
		cntError++;
		var Output2 = 'Please Enter Your Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
		
			
			if(document.getElementById('emp_fname').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee First Name';
		errorField[cntError] = 'emp_fname';
		cntError++;
		var Output2 = 'Please Enter Your Employee First Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
			
			
			if(document.getElementById('emp_lname').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Last Name';
		errorField[cntError] = 'emp_lname';
		cntError++;
		var Output2 = 'Please Enter Your Employee Last Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			
			
				
			if(document.getElementById('emp_desn').value=="0"  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please select Your Employee Designation';
		errorField[cntError] = 'emp_desn';
		cntError++;
		var Output2 = 'Please select Your Employee Designation';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			
				
			if(document.getElementById('emp_address').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Address';
		errorField[cntError] = 'emp_address';
		cntError++;
		var Output2 = 'Please Enter Your Employee Address';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			
			if(document.getElementById('emp_telno').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Telephone No';
		errorField[cntError] = 'emp_telno';
		cntError++;
		var Output2 = 'Please Enter Your Employee Telephone No';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
     if(!validateEmail(document.getElementById('emp_email').value,1,1)  && document.getElementById('indnew').value=="1"){
	errorMsg[cntError] = 'Email is not in Proper format';
	errorField[cntError] = 'emp_email';
		cntError++;
	var Output2 = 'Please Enter Your Email Address';
		document.getElementById("resultshere1").innerHTML = Output2;
		return false;
	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
	
		}
			
			
			
		
				
			
			
			
		
			
			
			if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			/*	if(document.getElementById('laptop_model').value=="0"){
		errorMsg[cntError] = 'Please Select Laptop Model';
		errorField[cntError] = 'laptop_model';
		cntError++;
		var Output2 = 'Please Select Laptop Model';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		*/
			
			
			
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
				
        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
		
}












function Validate_Accessories_Request_Type(frmName){ //               Common Java Script Files   
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('request_type').value=="0"){
		errorMsg[cntError] = 'Please Select Request Type & Employee Type';
		errorField[cntError] = 'request_type';
		cntError++;
		var Output2 = 'Please Select Request Type & Employee Type';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		
		if(document.getElementById('employee_type').value=="0"){
		errorMsg[cntError] = 'Please Select Request Type & Employee Type';
		errorField[cntError] = 'employee_type';
		cntError++;
		var Output2 = 'Please Select Request Type & Employee Type';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
		
		if(document.getElementById('indnew').value=="0"){
		errorMsg[cntError] = 'Please Press Go Button';
		errorField[cntError] = 'indnew';
		cntError++;
		var Output2 = 'Please Press Go Button';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
	if(document.getElementById('indnew').value=="2")		
	{		
		if(document.getElementById('emp_oldno').value==""){
		errorMsg[cntError] = 'Please Enter Employee Number';
		errorField[cntError] = 'emp_oldno';
		cntError++;
		var Output2 = 'Please Enter Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
			
			if(document.getElementById('emp_accessories_name').value==""){
		errorMsg[cntError] = 'Please Enter Your Accessories Name';
		errorField[cntError] = 'emp_accessories_name';
		cntError++;
		var Output2 = 'Please Enter Your Accessories Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
	
			
			
			
		
			
			
		if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
					
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}			
			
			
			
	}
	
	
	
	
	
	
	
	
	
	
	
	if(document.getElementById('indnew').value=="4")		
	{	
		

		if(document.getElementById('grpemp').value=="0")
		{
		var addgrpemp = 0;
		}
		
		else
		{
		var addgrpemp = document.getElementById('addgrpemp').value;	
		}
		
	

    for (var x = 0; x <= addgrpemp; x++)
    {
	   
	   if(document.getElementById('emp_oldno'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Number';
		errorField[cntError] = 'emp_oldno'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
	   
	   
	
	   
				
		
   }
			
			
			
		if(document.getElementById('emp_accessories_name').value==""){
		errorMsg[cntError] = 'Please Enter Your Accessories Name';
		errorField[cntError] = 'emp_accessories_name';
		cntError++;
		var Output2 = 'Please Enter Your Accessories Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
	
			
			
			
		
			
			
			
		if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
						
			
			
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';

		document.getElementById("resultshere1").innerHTML = Output2;
		
			}			
			
			
			
	}
	
	
	
	
	
	
	
	
		if(document.getElementById('indnew').value=="3")		
	{	
		

		if(document.getElementById('grpemp').value=="0")
		{
		var addgrpemp = 0;
		}
		
		else
		{
		var addgrpemp = document.getElementById('addgrpemp').value;	
		}
		
		

	for (var x = 0; x <= addgrpemp; x++)
   {
   
	   
	   if(document.getElementById('empno'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Number';
		errorField[cntError] = 'empno'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
	   
	   
	
	   
	
		if(document.getElementById('emp_fname'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee First Name';
		errorField[cntError] = 'emp_fname'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee First Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
			
			
			if(document.getElementById('emp_lname'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Last Name';
		errorField[cntError] = 'emp_lname'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Last Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			if(document.getElementById('emp_desn'+x+'').value=="0"){
		errorMsg[cntError] = 'Please select Your Employee Designation';
		errorField[cntError] = 'emp_desn'+x+'';
		cntError++;
		var Output2 = 'Please select Your Employee Designation';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
				
			if(document.getElementById('emp_address'+x+'').value=="" ){
		errorMsg[cntError] = 'Please Enter Your Employee Address';
		errorField[cntError] = 'emp_address'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Address';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			
			if(document.getElementById('emp_telno'+x+'').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Telephone No';
		errorField[cntError] = 'emp_telno'+x+'';
		cntError++;
		var Output2 = 'Please Enter Your Employee Telephone No';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
     if(!validateEmail(document.getElementById('emp_email'+x+'').value,1,1)){
	errorMsg[cntError] = 'Email is not in Proper format';
	errorField[cntError] = 'emp_email'+x+'';
		cntError++;
	var Output2 = 'Please Enter Your Email Address';
		document.getElementById("resultshere1").innerHTML = Output2;
		return false;
	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
	
		}
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
				
   }
   
   
   
   if(document.getElementById('emp_accessories_name').value==""){
		errorMsg[cntError] = 'Please Enter Your Accessories Name';
		errorField[cntError] = 'emp_accessories_name';
		cntError++;
		var Output2 = 'Please Enter Your Accessories Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
	
			
			
			
			
   
   
   
			
		if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}			
			
			
			
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
			
				
	if(document.getElementById('empno').value=="" && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Number';
		errorField[cntError] = 'empno';
		cntError++;
		var Output2 = 'Please Enter Your Employee Number';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
		
			
			if(document.getElementById('emp_fname').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee First Name';
		errorField[cntError] = 'emp_fname';
		cntError++;
		var Output2 = 'Please Enter Your Employee First Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
			
			
			if(document.getElementById('emp_lname').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Last Name';
		errorField[cntError] = 'emp_lname';
		cntError++;
		var Output2 = 'Please Enter Your Employee Last Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			if(document.getElementById('emp_desn').value=="0"  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please select Your Employee Designation';
		errorField[cntError] = 'emp_desn';
		cntError++;
		var Output2 = 'Please select Your Employee Designation';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
				
			if(document.getElementById('emp_address').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Address';
		errorField[cntError] = 'emp_address';
		cntError++;
		var Output2 = 'Please Enter Your Employee Address';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			
			
			
			
			
			if(document.getElementById('emp_telno').value==""  && document.getElementById('indnew').value=="1"){
		errorMsg[cntError] = 'Please Enter Your Employee Telephone No';
		errorField[cntError] = 'emp_telno';
		cntError++;
		var Output2 = 'Please Enter Your Employee Telephone No';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
     if(!validateEmail(document.getElementById('emp_email').value,1,1)  && document.getElementById('indnew').value=="1"){
	errorMsg[cntError] = 'Email is not in Proper format';
	errorField[cntError] = 'emp_email';
		cntError++;
	var Output2 = 'Please Enter Your Email Address';
		document.getElementById("resultshere1").innerHTML = Output2;
		return false;
	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
	
		}
			
			
			
		
			
			
			
			
		
	
			
			
			
			
		if(document.getElementById('emp_accessories_name').value==""){
		errorMsg[cntError] = 'Please Enter Your Accessories Name';
		errorField[cntError] = 'emp_accessories_name';
		cntError++;
		var Output2 = 'Please Enter Your Accessories Name';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
	
			
			
			
			
			
			if(document.getElementById('division').value=="0"){
		errorMsg[cntError] = 'Please Select Your Employee Division';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Select Your Employee Division';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('region').value==""){
		errorMsg[cntError] = 'Please Enter Your Employee Region';
		errorField[cntError] = 'region';
		cntError++;
		var Output2 = 'Please Enter Your Employee Region';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				
			
			
				if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Depot';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Depot';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
				if(document.getElementById('dispatch_location').value==""){
		errorMsg[cntError] = 'Please Enter Dispatch Location';
		errorField[cntError] = 'dispatch_location';
		cntError++;
		var Output2 = 'Please Enter Dispatch Location';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
			
			
			
			
			
				if(document.getElementById('doc3').value==""){
		errorMsg[cntError] = 'Please Select Dispatch Date';
		errorField[cntError] = 'doc3';
		cntError++;
		var Output2 = 'Please Select Dispatch Date';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}		
			
			
				
        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	} 
	}




function Validate_Registration()
{
	
		var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('userno').value==""){
		errorMsg[cntError] = 'Please Enter User No';
		errorField[cntError] = 'userno';
		cntError++;
		var Output2 = 'Please Enter User No';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		
		
		
	if(document.getElementById('user_type').value=="select"){
		errorMsg[cntError] = 'Please Select User Type';
		errorField[cntError] = 'user_type';
		cntError++;
		var Output2 = 'Please Select User Type';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}	
		
		
	if(document.getElementById('user_fname').value==""){
		errorMsg[cntError] = 'Please Enter User First Name';
		errorField[cntError] = 'user_fname';
		cntError++;
		var Output2 = 'Please Enter User First Name';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}		
		
	if(document.getElementById('user_lname').value==""){
		errorMsg[cntError] = 'Please Enter User Last Name';
		errorField[cntError] = 'user_lname';
		cntError++;
		var Output2 = 'Please Enter User Last Name';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}			
		
		
		
		
		
		
		if(document.getElementById('user_desn').value=="0"){
		errorMsg[cntError] = 'Please select User Designation';
		errorField[cntError] = 'user_desn';
		cntError++;
		var Output2 = 'Please select User Designation';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}			
		
		
		
		
		
		
		if(document.getElementById('user_address').value==""){
		errorMsg[cntError] = 'Please Enter User Address';
		errorField[cntError] = 'user_address';
		cntError++;
		var Output2 = 'Please Enter User Address';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}			
		
		
		
			if(document.getElementById('user_telno').value==""){
		errorMsg[cntError] = 'Please Enter User Tel No';
		errorField[cntError] = 'user_telno';
		cntError++;
		var Output2 = 'Please Enter User Tel No';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}			
	
	
	
	
	
	  if(!validateEmail(document.getElementById('user_email').value,1,1)){
	errorMsg[cntError] = 'Email is not in Proper format';
	errorField[cntError] = 'user_email';
		cntError++;
	var Output2 = 'Please Enter Your Email Address';
		document.getElementById("resultshere1").innerHTML = Output2;
		return false;
	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
	
		}
		
		
		
		
		
 if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}		
		
		
		
	
	
}



function Dispatch(value)
{
document.getElementById("dispatch_location_address").value = value;
	
}



function Disapprove(value,value1)
{

if(confirm('Are you sure you want to cancel this request? Changes cannot be undone.'))
{
	var myAjax = new Ajax.Request('disapprove_process.php', 
     {method: 'post', parameters: {disapprove_id: value, user_id: value1}, onComplete: handleResponse});
}
else

{
return false;	
}
	
	
}



function handleResponse(transport)
{
document.location.href ="view_request_main.php?v=success";
}		





function DisapproveAcc(value,value1,value2)
{
	
if(confirm('Are you sure you want to cancel this request? Changes cannot be undone.'))
{
	var myAjax = new Ajax.Request('disapproveacc_process.php', 
     {method: 'post', parameters: {disapprove_id: value, user_id: value1, depot_location: value2}, onComplete: handleResponse1});
}
else

{
return false;	
}
	
	
}


function handleResponse1(transport)
{
document.location.href ="view_accessories_request.php?v=success";
}		







function Disapprove_replacementAcc(value)
{
	
if(confirm('Are you sure you want to Reject this request?'))
{
	var myAjax = new Ajax.Request('disapprove_replace_acc.php', 
     {method: 'post', parameters: {disapprove_id: value}, onComplete: handleResponse2});
}
else

{
return false;	
}
	
	
}


function handleResponse2(transport)
{
document.location.href ="approve_replacement.php?v=success";
}		




function Disapprove_replacementLap(value)
{
	
if(confirm('Are you sure you want to Reject this request?'))
{
	var myAjax = new Ajax.Request('disapprove_replace_lap.php', 
     {method: 'post', parameters: {disapprove_id: value}, onComplete: handleResponse2});
}
else

{
return false;	
}
	
	
}


function handleResponse2(transport)
{
document.location.href ="approve_replacement.php?v=success";
}		




function checkpasswordForm(frmName){  //               Common Java Script Files   
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('currentpass').value==""){
		errorMsg[cntError] = 'Please Enter your Current password.';
		errorField[cntError] = 'currentpass';
		cntError++;
		var Output2 = 'Please Enter Your Current password';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		
		if(document.getElementById('newpass').value==""){
		errorMsg[cntError] = 'Please Enter Your New password';
		errorField[cntError] = 'newpass';
		cntError++;
		var Output2 = 'Please Enter Your New password';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
	if(document.getElementById('confirmpass').value==""){
		errorMsg[cntError] = 'Please Enter Your Confirm password';
		errorField[cntError] = 'confirmpass';
		cntError++;
		var Output2 = 'Please Enter Your Confirm password';
		document.getElementById("resultshere1").innerHTML = Output2;
       				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}
			
			
			
		if(document.getElementById('newpass').value!=document.getElementById('confirmpass').value){
		errorMsg[cntError] = 'Invalid Password Combination';
		errorField[cntError] = 'confirmpass';
		cntError++;
		var Output2 = 'Invalid Password Combination';
		document.getElementById("resultshere1").innerHTML = Output2;
		return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;
		
			}	
			

		
		
		

        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
		
}








function Validate_divison(frmName){  //               Common Java Script Files   
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('division').value==""){
		errorMsg[cntError] = 'Please Enter Division Name.';
		errorField[cntError] = 'division';
		cntError++;
		var Output2 = 'Please Enter Division Name.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		

        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
		
}





function Validate_designation(frmName){  //               Common Java Script Files   
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('designation').value==""){
		errorMsg[cntError] = 'Please Enter Designation Name.';
		errorField[cntError] = 'designation';
		cntError++;
		var Output2 = 'Please Enter Designation Name.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		

        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
		
}




function Validate_accessories(frmName){  //               Common Java Script Files   
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('accessories').value==""){
		errorMsg[cntError] = 'Please Enter Accessories Name.';
		errorField[cntError] = 'accessories';
		cntError++;
		var Output2 = 'Please Enter Accessories Name.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		

        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
		
}







function Validate_datacards(frmName){  //               Common Java Script Files   
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('datacards').value==""){
		errorMsg[cntError] = 'Please Enter Data Card Name.';
		errorField[cntError] = 'datacards';
		cntError++;
		var Output2 = 'Please Enter Data Card Name.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		

        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
		
}






function phoneValue(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 
        ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode!=45) {
      //  alert("Enter only numeric values\nThat is between 0-9\n in this field.");
        return false;
    }
    return true;
}


function validateEmail(addr,man,db){
		if (addr == '' && man) {
		   if (db) //alert('email address is mandatory');
		   return false;
		}
		var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
		for (i=0; i<invalidChars.length; i++) {
		   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
			  if (db) //alert('email address contains invalid characters');
			  return false;
		   }
		}
		for (i=0; i<addr.length; i++) {
		   if (addr.charCodeAt(i)>127) {
			  if (db) //alert("email address contains non ascii characters.");
			  return false;
		   }
		}

		var atPos = addr.indexOf('@',0);
		if (atPos == -1) {
		   if (db) //alert('email address must contain an @');
		   return false;
		}
		if (atPos == 0) {
		   if (db) //alert('email address must not start with @');
		   return false;
		}
		if (addr.indexOf('@', atPos + 1) > - 1) {
		   if (db) //alert('email address must contain only one @');
		   return false;
		}
		if (addr.indexOf('.', atPos) == -1) {
		   if (db) alert('email address must contain a period in the domain name');
		   return false;
		}
		if (addr.indexOf('@.',0) != -1) {
		   if (db) //alert('period must not immediately follow @ in email address');
		   return false;
		}
		if (addr.indexOf('.@',0) != -1){
		   if (db) alert('period must not immediately precede @ in email address');
		   return false;
		}
		if (addr.indexOf('..',0) != -1) {
		   if (db) //alert('two periods must not be adjacent in email address');
		   return false;
		}
		var suffix = addr.substring(addr.lastIndexOf('.')+1);
		if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
		   if (db) //alert('invalid primary domain in email address');
		   return false;
		}
		return true;
	}




function GetLapModel(value)
{
if(value=="MT")
{
	var myAjax = new Ajax.Request('mt_models.php', 
     {method: 'post', parameters: {mt_id: value}, onComplete: handleResponseMT});
}
else
{
document.getElementById("NonMtLap").style.display="block";
document.getElementById("MtLap").innerHTML="";
document.getElementById("MtLap").style.display="none";

return false;	
}
}




function handleResponseMT(transport)
{
document.getElementById("MtLap").innerHTML =transport.responseText;
document.getElementById("MtLap").style.display="block";
document.getElementById("NonMtLap").style.display="none";
//document.location.href ="view_request_main.php?v=success";
}		



function GetSerialNo(value)
{
	var myAjax = new Ajax.Request('serial_numbers.php', 
     {method: 'post', parameters: {laptopmodel_id: value}, onComplete: handleResponseSerial});
}


function handleResponseSerial(transport)
{
document.getElementById("serial_no").innerHTML =transport.responseText;
}		




function Validate_transfer()
{
	var cntError = 0;
	var errorMsg = Array();
	var errorField = Array();
	var frm = document.frmName;
	//var frm = document.frmName;
		if(document.getElementById('laptop_model').value=="0"){
		errorMsg[cntError] = 'Please Select Laptop Models.';
		errorField[cntError] = 'laptop_model';
		cntError++;
		var Output2 = 'Please Select Laptop Models.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
	
	
	
	if(document.getElementById('depot').value=="0"){
		errorMsg[cntError] = 'Please Select Transfer From Location.';
		errorField[cntError] = 'depot';
		cntError++;
		var Output2 = 'Please Select Transfer From Location.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		
		
		if(document.getElementById('depotto').value=="0"){
		errorMsg[cntError] = 'Please Select Transfer To Location.';
		errorField[cntError] = 'depotto';
		cntError++;
		var Output2 = 'Please Select Transfer To Location.';
		document.getElementById("resultshere1").innerHTML = Output2;
				return false;

	}
	else
	{
		var Output2 = '';
		document.getElementById("resultshere1").innerHTML = Output2;

	}
		
	
		

        if(errorMsg.length > 0){
		//alert(errorMsg);
		
		
		return false;
	}else{
		//document.frm.submit();
		return true;
	}
}







function GetOrgnSubst(value)
{
	var myAjax = new Ajax.Request('get_modelname.php', 
     {method: 'post', parameters: {id: value}, onComplete: handleResponseorgsubst});
}






function handleResponseorgsubst(transport)
{
document.getElementById("OrgnSubst").innerHTML =transport.responseText;
}		




function check(value)
{
var laptoptype = document.getElementById("lap_type").value;
var myAjax = new Ajax.Request('check_request.php', 
     {method: 'post', parameters: {empno: value, laptype: laptoptype}, onComplete: handleResponseCheck});
}


function handleResponseCheck(transport)
{
var laptoptype = document.getElementById("lap_type").value;

if(transport.responseText=='Hide')
{
document.getElementById("submitbutt").style.display ='none';
document.getElementById("resultshere1").innerHTML = 'Laptop is already Requested';
}
}	

function goURL(element)
{
var newURL = window.location.href.split('?')[0] + '?' + window.location.search.substring(1).split('&')[0] + '&DL=' + element;
window.location.href = newURL;
}


function downloadLaptopUndeliReportData()
{

   window.location.href='download_report.php?mode=lapundelievered';
}

function downloadPendLaptopReportData()
{
	var pending_value=document.getElementById("pending_value").value;
	window.location.href='download_report.php?mode=pendingLaptop&id='+pending_value;
}

function downloadPendAccessoriesReportData()
{
	var pending_value=document.getElementById("pending_accvalue").value;
	window.location.href='download_report.php?mode=pendingAccessories&id='+pending_value;
}
function downloadLaptopdeliReportData()
{
	var sdate=document.getElementById("del_sdate").value;
	var edate=document.getElementById("del_edate").value;
	window.location.href='download_report.php?mode=lapdelievered&startDate='+sdate+'&endDate='+edate;
}
function downloadLaptopDispatchReportData()
{
	var sdate=document.getElementById("del_sdate").value;
	var edate=document.getElementById("del_edate").value;
	window.location.href='download_report.php?mode=lapdispatched&startDate='+sdate+'&endDate='+edate;
}

function downloadAccesDispatchReportData()
{
	var sdate=document.getElementById("del_sdate").value;
	var edate=document.getElementById("del_edate").value;
	window.location.href='download_report.php?mode=accdispatched&startDate='+sdate+'&endDate='+edate;
}

function Disapprove(value,value1)
{

if(confirm('Are you sure you want to cancel this request? Changes cannot be undone.'))
{
	var myAjax = new Ajax.Request('disapprove_process.php', 
     {method: 'post', parameters: {disapprove_id: value, user_id: value1}, onComplete: handleResponse});
}
else

{
return false;	
}

}

function DisapproveAcc(value,value1)
{
	
if(confirm('Are you sure you want to cancel this request? Changes cannot be undone.'))
{
	var myAjax = new Ajax.Request('disapproveacc_process.php', 
     {method: 'post', parameters: {disapprove_id: value, user_id: value1}, onComplete: handleResponse1});
}
else

{
return false;	
}
	
	
}


function downloadEmpQueryReportData()
{
	var empid=document.getElementById("empquery").value;
	alert(empid);
	window.location.href='download_report.php?mode=empQueryReport&empid='+empid;
}

function downloadaccdeliReportData()
{
	var sdate=document.getElementById("sdate").value;
	var edate=document.getElementById("edate").value;
	window.location.href='download_report.php?mode=accdelievered&startDate='+sdate+'&endDate='+edate;
}

function downloadAccReportData()
{
	var sdate=document.getElementById("sdate").value;
	var edate=document.getElementById("edate").value;
	window.location.href='download_report.php?mode=accreport&startDate='+sdate+'&endDate='+edate;
}

function downloadAccStockReportData()
{
	var sdate=document.getElementById("sdate").value;
	var edate=document.getElementById("edate").value;
	window.location.href='download_report.php?mode=accStockreport&startDate='+sdate+'&endDate='+edate;
}

function downloadAccStockDailyReportData()
{
	var tdate=document.getElementById("tdate").value;
	window.location.href='download_report.php?mode=accStockDailyReport&tdate='+tdate;
}

function downloadLaptopDepotData()
{
	var laptype=document.getElementById("laptypeid").value;
	window.location.href='download_report.php?mode=laptopindepot&laptype='+laptype;
}

function downloadLaptopStatusReportData()
{
	var lapstatus=document.getElementById("status").value;
	window.location.href='download_report.php?mode=laptopstatus&status='+lapstatus;
}
function downloadaccempSerialdeliReportData()
{   var lapname=document.getElementById("model").value;
	window.location.href='download_report.php?mode=queryonlap&lapname='+lapname;
}





